<template>
  <div class="right-container">
    <h3>Right 组件---父传{{msg}}</h3>
    <h4>{{count}}</h4>
    <button @click="add">+1</button>
  </div>
</template>

<script>
import bus from '@/event/eventBus.js'
export default {
  data() {
    return {
      count: 1
    }
  },
  props: {
    msg: String
  },
  methods: {
    add() {
      this.count++
      this.$emit('count', this.count)
      bus.$emit('share', this.count)
    }
  }
}
</script>

<style lang="less">
.right-container {
  padding: 0 20px 20px;
  background-color: lightskyblue;
  min-height: 250px;
  flex: 1;
}
</style>
